#include<iostream>
#include<queue>
#include<string>
using namespace std;

class Person
{
public:
	string name;
	int age;
	
	Person(string name, int age)
	{
		this->name = name;
		this->age = age;
	}
};

int main()
{
	queue<Person> q;
	
	Person p1("tang", 114);
	Person p2("sun", 514);
	Person p3("zhu",11);
	Person p4("sha", 45);
	
	q.push(p1);
	q.push(p2);
	q.push(p3);
	q.push(p4);
	
	cout << "size:" << q.size() << endl;
	
	while (!q.empty())
	{
		cout << "front:" << q.front().name << '\t' << q.front().age << endl;
		cout << "back:" << q.back().name << '\t' << q.back().age << endl;
		q.pop();
	}
	
	cout << "size:" << q.size() << endl;
	return 0;
}
